#ifndef COMMON_H
#define COMMON_H

#endif // COMMON_H
#include <QMessageBox>
#include <QBasicTimer>
#include <QCache>
#include <QImage>
#include <QKeyEvent>
#include <QPainter>
#include <QPixmap>
#include <QTimer>
#include <QVector>
#include <QWidget>
#include <QTime>
#include <QDialog>
#include <QDomDocument>
//#include <QtGui>
#include <QXmlStreamReader>
#include <QDir>
#include <qdebug.h>

// key map
#define KEYPAD_1    Qt::Key_0
#define KEYPAD_2    Qt::Key_7
#define KEYPAD_3    Qt::Key_Period
#define KEYPAD_4    Qt::Key_1
#define KEYPAD_5    Qt::Key_2
#define KEYPAD_6    Qt::Key_3
#define KEYPAD_7    Qt::Key_4
#define KEYPAD_8    Qt::Key_5
#define KEYPAD_9    Qt::Key_6
#define KEYPAD_0    Qt::Key_Backspace
#define KEYPAD_ENTER Qt::Key_Enter

//pasword
#define PASSSWORD_LENGTH 8

//mini2440 client constraint
#define DEFAULT_INPUT_TIMEOUT 10000
#define SIZING_FACTOR_HEIGHT 5/10
#define SIZING_FACTOR_WIDTH 5/10

#define INBOX_ICON_PATH     "./screenshots/MAC/Message.png"
#define INBOX_NEW_ICON_PATH "./screenshots/MAC/NewMessage.png"
#define CAMERA_ICON_PATH    "./screenshots/MAC/Camera.png"
#define SETTING_ICON_PATH   "./screenshots/MAC/Setting.png"
#define CHANGEPASS_ICON_PATH "./screenshots/MAC/ChangePass.png"

#define MESSAGE_FILE_FILTER "*.msg"
#define MESSAGE_DIR_PATH    "./Messages"

#ifdef LOCALIZATION_TV
//define localization string here
//#define INBOX_
#endif

/*Command route*/
//client send to server
#define COMMAND_DOOR_OPEN       0x101
#define COMMAND_DOOR_CLOSE      0x102
#define COMMAND_DOOR_LOCK       0x103
#define COMMAND_DOOR_ALARM      0x104
#define COMMAND_DOOR_WRONGPASS  0x105
//server send to client
#define COMMAND_RESET_PASSWORD  0x114
#define COMMAND_MESSAGE         0x115
